home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '90 / Other Stuff / Networking ƒ / ATP Sample App / code fragments / looking next >
Encoding:
Text File  |  1990-06-12  |  761 b   |  26 lines  |  [TEXT/MPS ]

  1.     nbp_iopb.ioCompletion = 0;
  2.     nbp_iopb.ioRefNum = MPP_REFNUM;
  3.     nbp_iopb.csCode = lookupName;
  4.     nbp_iopb.interval = 5;
  5.     nbp_iopb.count = 2;
  6.     
  7.     printf("looking in zone '%s' for server '%s'\n", theZone, theName);
  8.     if (nbp_iopb.ntQElPtr == 0)
  9.         nbp_iopb.ntQElPtr = MakeEntity(theName, NBP_SERVER_TYPE, theZone);
  10.  
  11.     if (lookupBuffer == (byte *)0)
  12.         lookupBuffer = (byte *)NewPtr( (long)NBP_BUFFER_SIZE );
  13.  
  14.     nbp_iopb.nbp.lookup.retBuffPtr = lookupBuffer;
  15.     nbp_iopb.nbp.lookup.retBuffSize = NBP_BUFFER_SIZE;
  16.     nbp_iopb.nbp.lookup.maxToGet = 1000;
  17.     nbp_iopb.nbp.lookup.numGotten = 0;
  18.     
  19.     printf("looking for server...\n");
  20.     result = PBControl(&nbp_iopb, FALSE);
  21.     if (result != noErr)
  22.         return FALSE;
  23.     
  24.     printf("done, found %d servers\n",
  25.             nbp_iopb.nbp.lookup.numGotten);
  26.